package com.bdqn.ssm.web;

import com.bdqn.ssm.entity.Clazz;
import com.bdqn.ssm.service.IClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/2/25.
 */
@Controller
@RequestMapping("/clazz")
public class ClazzController {
    @Autowired
    IClazzService clazzService;
    @GetMapping("/clazzs")
    public String showClazzes(ModelMap modelMap){
     List<Clazz> clazzs=clazzService.listAll();
        modelMap.put("clazzs",clazzs);
        return "hello";
    }
}
